package com.cn.common;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;

public class QueueData {

    private String brokerName;

    private String topic;

    //写队列数
    private int writeQueue;

    //读队列数
    private int readQueue;

    public QueueData() {

    }

    public QueueData(String brokerName, String topic, int queueId, int writeQueue, int readQueue) {
        this.brokerName = brokerName;
        this.topic = topic;
        this.writeQueue = writeQueue;
        this.readQueue = readQueue;
    }

    public String getBrokerName() {
        return brokerName;
    }

    public void setBrokerName(String brokerName) {
        this.brokerName = brokerName;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public int getWriteQueue() {
        return writeQueue;
    }

    public void setWriteQueue(int writeQueue) {
        this.writeQueue = writeQueue;
    }

    public int getReadQueue() {
        return readQueue;
    }

    public void setReadQueue(int readQueue) {
        this.readQueue = readQueue;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        QueueData old = (QueueData) obj;
        if (brokerName == null) {
            if (old.getBrokerName() != null) {
                return false;
            }
        } else if (!brokerName.equals(old.getBrokerName())) {
            return false;
        }

        if (topic == null) {
            if (old.getTopic() != null) {
                return false;
            }
        } else if (!topic.equals(old.getTopic())) {
            return false;
        }

        if (writeQueue != old.getWriteQueue()) {
            return false;
        }
        if (readQueue != old.getReadQueue()) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "QueueData{" +
                "brokerName='" + brokerName + '\'' +
                ", topic='" + topic + '\'' +
                ", writeQueue=" + writeQueue +
                ", readQueue=" + readQueue +
                '}';
    }

    public static void main(String[] args){

    }

}
